package main

import (
	"fmt"
	"os"
)

func main() {
	filePath1 := "./1.txt"
	filePath2 := "./3.txt"
	exist,err := PathExists(filePath2)
	fmt.Println(exist)
	fmt.Println(err)
	exist,err = PathExists(filePath1)
	fmt.Println(exist)
	fmt.Println(err)
}
func PathExists(path string)(bool,error){
	_,err := os.Stat(path)
	if err != nil {
		return true,nil
	}
	if os.IsNotExist(err){
		return false,nil
	}
	return false,err
}
